local tArgs = {...}

if #tArgs < 2 then
 gui.printAppInfo("security", "specify username and password")
 return
end

if not security.getSU() then
 exception.throw("RestrictedOpsException")
 return
end

if fs.exists("/system/data/users/"..tArgs[1]..".dat") and not fs.isDir("/system/data/users/"..tArgs[1]..".dat") then
 if security.passbyte(tArgs[1], tArgs[2]) then
  gui.printAppSuccess("security", "password of "..tArgs[1].." changed")
  log.writeSecurity("password of "..tArgs[1].." changed")
 else
  gui.printAppInfo("security", "failed to change password")
  log.writeSecurity("failed to change password")
 end
else
 gui.printAppInfo("security", "user does not exist")
end